﻿<%@ Page Title="" Language="C#" MasterPageFile="~/settings/SettingsMaster.master" AutoEventWireup="true" Inherits="Settings.Admin.ListUsers" Codebehind="ListUsers.aspx.cs" %>

<%@ Register Assembly="AjaxControlToolkit" Namespace="AjaxControlToolkit" TagPrefix="ajaxToolkit" %> 
<%@ Register src="../Controls/EntityEdit.ascx" tagname="EntityEdit" tagprefix="uc1" %>
<%@ Register src="../Controls/ListPaging.ascx" tagname="ListPaging" tagprefix="uc2" %>

<asp:Content ID="Content1" ContentPlaceHolderID="head" Runat="Server">
</asp:Content>

<asp:Content ID="Content2" ContentPlaceHolderID="ContentPlaceHolder1" Runat="Server">
    
<div>
 <asp:UpdatePanel ID="udpOutterUpdatePanel" runat="server"> 
     <ContentTemplate> 
        
        <h2 class="pagetitle">User list</h2>

        <asp:Literal ID="litThing" runat="server"  />

        <uc2:ListPaging ID="listPaging" runat="server" OnPageSelectionChange="listPaging_Changed" />
        
        <asp:Button id="btnFilterOpt" runat="server" text="filter" OnClick="btnFilterOpt_Click" />

        <asp:DataGrid ID="grdUsers" runat="server" AutoGenerateColumns="false" 
                OnItemCommand="grdUser_ItemCommand" onitemdatabound="grdUsers_ItemDataBound" >
            <Columns>
                <asp:BoundColumn DataField="Id" ReadOnly=true Visible="false" />
                <asp:BoundColumn DataField="ScreenName" HeaderText="Screen" />
                <asp:BoundColumn DataField="Name"  />
                <asp:BoundColumn DataField="Role" />
                <asp:BoundColumn DataField="Design" />
                <asp:BoundColumn DataField="LoginCount"  />                
                <asp:BoundColumn DataField="LastLogin" />
                
                <asp:TemplateColumn ItemStyle-HorizontalAlign="Right">
                    <ItemTemplate>
                        <asp:Button id="btnEdit" runat="server" CommandName="Edit" Text="Edit" ButtonType="PushButton" CssClass="greenbutton" />
                    </ItemTemplate>
                </asp:TemplateColumn>
            </Columns>
        </asp:DataGrid>

        <ajaxToolkit:ModalPopupExtender runat="server" 
                ID="mpeThePopup" 
                TargetControlID="dummy" 
                PopupControlID="pnlModalPopUpPanel" 
                BackgroundCssClass="modalBackground"                        
                DropShadow="false"/> 

            <input id="dummy" type="button" style="display: none" runat="server" /> 

         <asp:Panel ID="pnlModalPopUpPanel" runat="server" CssClass="modalPopup"  style="display:none;" >             
            <asp:UpdatePanel ID="udpInnerUpdatePanel" runat="Server" UpdateMode="Conditional"> 
                <ContentTemplate>     
                    <asp:ImageButton ID="btnClose" runat="server" ImageUrl="~/Images/dialog-close.png" style="position:absolute; top: -10px; right:-10px;" />
                    <uc1:EntityEdit ID="editUser" runat="server" Caption="User" OnUpdate="editUser_Update" />
                </ContentTemplate>       

            </asp:UpdatePanel> 
        </asp:Panel>

        <ajaxToolkit:ModalPopupExtender runat="server" 
                ID="mpeFilterOpts" 
                TargetControlID="dummy2" 
                PopupControlID="pnlFilter" 
                BackgroundCssClass="modalBackground"                        
                DropShadow="false"/> 

            <input id="dummy2" type="button" style="display: none" runat="server" /> 

         <asp:Panel ID="pnlFilter" runat="server" CssClass="modalPopup"  style="display:none;" >             
            <asp:UpdatePanel ID="UpdatePanel1" runat="Server" UpdateMode="Conditional"> 
                <ContentTemplate>     
                    <asp:ImageButton ID="ImageButton1" runat="server" ImageUrl="~/Images/dialog-close.png" style="position:absolute; top: -10px; right:-10px;" />
                    
                    
                    <div class="formBox">
                    <h4>Filter results</h4>
                    <table cellpadding="0" cellspacing="1" border="0" width="100%">
                        <tr>
                            <td width="25%" align="right" class="lbl">Screenname Like</td>
                            <td width="75%">
                                <asp:TextBox ID="txtNameLike" runat="server" class="txtbox" />
                            </td>
                        </tr>
                        <tr>
                            <td align="right" class="lbl">In role</td>
                            <td>
                                <asp:DropDownList ID="drpRoles" runat="server" />
                            </td>
                        </tr>
                        <tr>
                            <td align="right" class="lbl">Theme</td>
                            <td>
                                <asp:DropDownList ID="drpTheme" runat="server" />
                            </td>
                        </tr>
                        <tr>
                            <td align="right" colspan="2">
                                <asp:Button ID="btnUpdate" runat="server" class="greenbutton" Text="Save" OnClick="btnUpdate_Click" />                                
                            </td>                            
                        </tr>
                    </table>
                    
                    </div>
                    
                </ContentTemplate>       

            </asp:UpdatePanel> 
        </asp:Panel>
    
    </ContentTemplate> 
</asp:UpdatePanel> 
</div>       



</asp:Content>

